<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags/templates" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<c:set var="applicationPath" value="${pageContext.request.contextPath}"/>

<t:main>
    <jsp:body>
        <c:if test="${persisted}">
            <div class="alert alert-success" >
                <spring:message code="alert.register.save.success" />
            </div>
        </c:if>
        <form:form commandName="subject" action="${applicationPath}/subject/save" method="post" >
            <div class="form-group">
                <form:label path="name"><spring:message code="label.name" /></form:label><br/>
                <form:input id="itName" path="name" maxlength="70" size="30" />
            </div>
            <div class="form-group">
                <form:label path="discipline"><spring:message code="label.name" /></form:label><br/>
                <form:select id="slDiscipline" path="discipline" items="${disciplines}" itemLabel="name" itemValue="id" >
                </form:select>
            </div>
            <form:hidden path="id"/>
            <button type="submit"><spring:message code="action.submit" /></button>
        </form:form>
        <a href="${applicationPath}/subject/list"><spring:message code="navigation.discipline.list" /></a>
    </jsp:body>
</t:main>